package com.yu;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Transaction;

/**
 * @Description: TODO
 * @Author : yu
 * Date : 4/12/2020 10:53 PM
 */
public class TestPing {
    public static void main(String[] args) {
        //  1、new Jedis对象
        Jedis jedis = new Jedis("127.0.0.1", 6379, false);
        System.out.println(jedis.ping());
        jedis.set("k1","1");
        jedis.watch("k1");
        Transaction multi = jedis.multi();
        multi.incrBy("k1",20);
        multi.get("k1");
        multi.exec();
        System.out.println(jedis.get("k1"));
        jedis.close();
    }
}
